/**
 * 
 */
package net.yangying.androidframework.util;

import net.yangying.androidframework.R;
import android.content.Context;
import android.graphics.drawable.Drawable;

/**
 * 定义各种颜色的动态变化
 * 
 * @author yangying
 * @date 2013-5-28 下午3:28:55
 * @version 1.0
 *
 */
public class BackgroundParser {

	public static final String BLUE = "blue";
	public static final String RED = "red";
	public static final String GREEN = "green";
	public static final String YELLOW = "yellow";
	public static final String PURPLE = "purple";
	public static Drawable getDrawable(Context context, String color){
		if(color == null){
			return context.getResources().getDrawable(R.drawable.site_red);
		}
		if(RED.equals(color)){
			return context.getResources().getDrawable(R.drawable.site_red);
		}
		if(BLUE.equals(color)){
			return context.getResources().getDrawable(R.drawable.site_blue);
		}
		if(GREEN.equals(color)){
			return context.getResources().getDrawable(R.drawable.site_green);
		}
		if(YELLOW.equals(color)){
			return context.getResources().getDrawable(R.drawable.site_yellow);
		}
		if(PURPLE.equals(color)){
			return context.getResources().getDrawable(R.drawable.site_purple);
		}
		return context.getResources().getDrawable(R.drawable.site_red);
	}
}
